const babelCore = require('@babel/core')

const code = `
  const a = /o+/y;
`
const result = babelCore.transformSync(code, {
  plugins: ["@babel/plugin-transform-sticky-regex"]
})

console.log(result.code);